/**      
 * @file		switch3.cpp
 * @description		This file demonstrates the use of enums
 *			enums Speed and Freeway are user defined
 *			types. Initialization of enums is an integer
 *			value which starts at 0 unless specified.
 * @course		CSCI 123 Section 00000
 * @assignment		Sample 7
 * @date		mm/dd/yyyy
 * @author		Brad Rippe (00000000) brippe@fullcoll.edu
 * @version		1.0
 */
#include <iostream>
using namespace std;

/**
 * @return zero if the application executes successfully
 */
int main() {
	// The enums FAST, NORMAL, etc are capitalized because
	// they are constant for the life of the program.
	// Constants are capitalized using a "_" underscore character
	// to divide words in the variable name
	enum Speed	{ FAST, NORMAL, SLOW };
	enum Freeway 	{ NINETY_ONE = 91, FOUR_O_FIVE = 405, 
				   ONE_O_ONE = 101, TWENTY_TWO = 22 };

	Speed speed;		// This is my new type, not given by C++
	Freeway freeway;	// This is my new type, not given by C++
	int ans = 0;

	cout << "Please tell me what freeway you're driving on?\n";
	cout << "type 91 for the 91, 405 for the 405, 101 for the 101,";
	cout << " or 22 for the 22\n";
	cin >> ans;
	switch(ans) {
		case NINETY_ONE:
			freeway = NINETY_ONE;
			break;
		case FOUR_O_FIVE:
			freeway = FOUR_O_FIVE;
			break;
		case ONE_O_ONE:
			freeway = ONE_O_ONE;
			break;
		case TWENTY_TWO:
			freeway = TWENTY_TWO;
			break;
		default:
			cout << "You have given me an incorrect freeway, bye!\n";
			return 0;	// I can terminate the application any time
					// I feel the user isn't playing nice

	}

	cout << "Please tell me how fast you plan on driving?\n";
	cout << "type 0 for fast, 1 for normal, 2 for slow\n";
	cin >> ans;
	switch(ans) {
		case FAST:
			speed = FAST;
			break;
		case NORMAL:
			speed = NORMAL;
			break;
		case SLOW:
			speed = SLOW;
			break;
		default:
			cout << "You have given me an incorrect speed, bye!\n";
			return 0;
	}

	cout << "You're driving on the " << freeway << endl;
	cout << "You're traveling ";

	switch(speed) {
		case FAST:
			cout << " FAST (move to the left)!\n";
			break;
		case NORMAL:
			cout << " the speed limit (good boy)!\n";		
			break;
		case SLOW:
			cout << " slow (move to right)!\n";		
			break;
	}
	return 0;
}
